﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinImageTag
{
    public partial class FrmMain : Form
    {
        string imgDir = "";

        public FrmMain()
        {
            InitializeComponent();
        }

        private void FrmMain_Load(object sender, EventArgs e)
        {
            ConfigUtils.imgPath = FilesINI.ReadIni("config", "Path");
            ConfigUtils.tags = FilesINI.ReadIni("config",  "Tags");
        }

        private void 图片管理IToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmImage frm= new FrmImage();
            frm.MdiParent=this;
            frm.Show();
        }

        private void 关于AToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AboutBox box=new AboutBox();
            box.ShowDialog();
        }

        private void 目录设置DToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmSetPath frm=new FrmSetPath();
            frm.ShowDialog();
        }

        private void 图片搜索SToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmSearch frm=new FrmSearch();
            frm.MdiParent = this;
            frm.Show();
        }

        private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (MessageBox.Show("确定要退出吗？", "退出确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
            {
                e.Cancel = true;
            }
        }
    }
}
